#include "InterpConditions.h"

int main(int argc, char* argv[]){
  InterpConditions<double,2> IC;
  vector<vector<double> > doubleTab;
  double tmp1[4] = {1.1,2,3,4.5};
  vector<double> doubleVec0(tmp1,tmp1+4);
  vector<double> doubleVec1(4,1.2);
  vector<double> doubleVec2(4.-0.3);
  doubleVec2[0] = 2.3;
  doubleTab.push_back(doubleVec0);
  doubleTab.push_back(doubleVec1);
  doubleTab.push_back(doubleVec2);
  vector<vector<bool> > boolTab;
  vector<bool> boolVec0(4,1);
  vector<bool> boolVec1(4,1);
  bool tmp2[4] = {1,0,0,1};
  vector<bool> boolVec2(tmp2,tmp2+4);
  boolTab.push_back(boolVec0);
  boolTab.push_back(boolVec1);
  boolTab.push_back(boolVec2);
  IC.setTable(doubleTab,boolTab);
  InterpConditions<double,2> IC2(doubleTab,boolTab);
  const vector<vector<double> > vvd = IC.getTable();
  const vector<vector<bool> > vvb = IC2.getBoolTable();
  cout << "Test for Input by vector:" << endl;
  cout << "Expect: 1.1 , 4.5 , 1.2 , 2.3 , 1 , 1 , 0 " << endl;
  cout << "Result: " << vvd[0][0] << " , " << vvd[0][3] << " , " << vvd[1][2]
       << " , " << vvd[2][0] << " , " << vvb[1][1] << " , " << vvb[2][0] << " , " << vvb[2][2] << endl;
  InterpConditions<double,2> IC3("Inputfile/testfile/test1");
  const vector<vector<double> > vvd2 = IC3.getTable();
  const vector<vector<bool> > vvb2 = IC3.getBoolTable();
  cout << "Test for Input by file:" << endl;
  cout << "Expect: 2.4 , 8.8 , 2 , 0 , 1 , 1 , 0 " << endl;
  cout << "Result: " << vvd2[0][1] << " , " << vvd2[0][3] << " , " << vvd2[1][0]
       << " , " << vvd2[2][1] << " , " << vvb2[1][1] << " , " << vvb2[2][0] << " , " << vvb2[2][3] << endl;
  cout << "Test for << operator:" << endl;
  cout << IC3;
}
